<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" >

  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/turbolinks/5.2.0/turbolinks.js" integrity="sha256-iM4Yzi/zLj/IshPWMC1IluRxTtRjMqjPGd97TZ9yYpU=" crossorigin="anonymous"></script>
  <link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css?family=Cousine|Inconsolata" rel="stylesheet">
  <link rel="shortcut icon" type="image/png" href="/favicon.png">

  <link rel="stylesheet" href="/css/style.css">
  <link rel="stylesheet" href="/css/css/fontawesome-all.min.css">
  <link rel="stylesheet" href="/css/css/work-sans-v7.css">
  <script src="/js/main.js"></script>

  <!-- Begin Jekyll SEO tag v2.6.1 -->
<title>Quickstart | Hive Developer</title>
<meta name="generator" content="Jekyll v4.0.0" />
<meta property="og:title" content="Quickstart" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="Hive Developer Documentation." />
<meta property="og:description" content="Hive Developer Documentation." />
<link rel="canonical" href="https://developers.hive.io/quickstart/" />
<meta property="og:url" content="https://developers.hive.io/quickstart/" />
<meta property="og:site_name" content="Hive Developer" />
<script type="application/ld+json">
{"description":"Hive Developer Documentation.","@type":"WebPage","url":"https://developers.hive.io/quickstart/","headline":"Quickstart","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->


  
</head>
<body>
<header>
  <h1>
    <button type="button" class="open-nav" id="open-nav"></button>
    <a href="/"  class="logo-link"><img src="/images/logotype_black.svg" height="40" alt="Hive Developer logo"></a>
  </h1>

  
  <form action="/search/" method="get">
    <input type="text" name="q" id="search-input" placeholder="Search">
    <input type="submit" value="Search" style="display: none;">
  </form>
  

  <div id="sidebar" class="sidebar">
	
	
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/">
		<h6 class="ctrl-nav-section title">Introduction</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/#introduction-welcome">Welcome to Hive</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/quickstart/">
		<h6 class="ctrl-nav-section title">Quickstart</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/quickstart/#quickstart-choose-library">Choose Library</a></li>
						
					
						
						<li><a href="/quickstart/#quickstart-hive-full-nodes">Hive Nodes</a></li>
						
					
						
						<li><a href="/quickstart/#quickstart-testnet">Hive Testnet</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/tutorials/">
		<h6 class="ctrl-nav-section title">Tutorials</h6>
		<ul class="cont-nav-section content">
			
				
					
						<li><a href="/tutorials/#tutorials-javascript">Javascript</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-python">Python</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-ruby">Ruby</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-recipes">Recipes</a></li>
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/services/">
		<h6 class="ctrl-nav-section title">Services</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/services/#services-hive-blog">hive.blog</a></li>
						
					
						
						<li><a href="/services/#services-hivesigner">HiveSigner</a></li>
						
					
						
						<li><a href="/services/#services-jussi">Jussi</a></li>
						
					
						
						<li><a href="/services/#services-imagehoster">ImageHoster</a></li>
						
					
						
						<li><a href="/services/#services-dhf">DHF</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/apidefinitions/">
		<h6 class="ctrl-nav-section title">Appbase API</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/apidefinitions/#apidefinitions-condenser-api">Condenser Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-bridge">Bridge</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-account-by-key-api">Account By Key Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-account-history-api">Account History Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-block-api">Block Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-database-api">Database Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-debug-node-api">Debug Node Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-follow-api">Follow Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-jsonrpc">Jsonrpc</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-market-history-api">Market History Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-network-broadcast-api">Network Broadcast Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-rc-api">Rc Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-reputation-api">Reputation Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-rewards-api">Rewards Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-tags-api">Tags Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-transaction-status-api">Transaction Status Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-witness-api">Witness Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-broadcast-ops">Broadcast Ops</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-broadcast-ops-communities">Broadcast Ops Communities</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/resources/">
		<h6 class="ctrl-nav-section title">Resources</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/resources/#resources-overview">Overview</a></li>
						
					
						
						<li><a href="/resources/#resources-client-libs">Client Libraries</a></li>
						
					
						
						<li><a href="/resources/#resources-bluepaper">Bluepaper</a></li>
						
					
						
						<li><a href="/resources/#resources-whitepaper">Whitepaper</a></li>
						
					
						
						<li><a href="/resources/#resources-tools">Tools</a></li>
						
					
						
						<li><a href="/resources/#resources-hivesigner-libs">Hivesigner Libs</a></li>
						
					
						
						<li><a href="/resources/#resources-hive-keychain">Hive Keychain</a></li>
						
					
						
						<li><a href="/resources/#resources-developeradvocate">Community & Help</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/glossary/">
		<h6 class="ctrl-nav-section title">Glossary</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/glossary/#glossary-chain-basics">Chain Basics</a></li>
						
					
						
					
						
						<li><a href="/glossary/#glossary-governance">Governance</a></li>
						
					
						
						<li><a href="/glossary/#glossary-transactions">Transactions</a></li>
						
					
						
						<li><a href="/glossary/#glossary-api">API</a></li>
						
					
						
						<li><a href="/glossary/#glossary-market">Market</a></li>
						
					
				
			
		</ul>
	</section>
	
</div>



  <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
</header>
<div class="main" id="top">
  <div class="hero">
    <h1 class="hero__h1">Hive Developer Portal  - Quickstart</h1>
    <img class="hero__img" src="/images/honey-comb-92.png" style="position: relative; top: 10px;" />
  </div>
  

	
	
		<section id="quickstart-choose-library" class="row quickstart-choose-library">
			<h3>
				<a id="quickstart-choose-library">
					Choose Library
					
				</a>
			</h3>
			

			<p>Getting started to develop robust and feature rich <strong>Hive</strong> applications couldn’t be easier. Accessing hive data is easy from various options depending on your infrastructure and objectives.</p>

<p>Building a picture discovery app is a breeze with the <a href="/tutorials/#tutorials-javascript">JavaScript</a> library. There is also a <a href="/tutorials/#tutorials-python">Python</a> library available, <a href="/services/#services-steemit">Steemit.com</a> and <a href="/services/#services-sbds">SBDS</a> services, as well as many <a href="/resources/#resources-overview">community projects</a> which could be beneficial for your steem project.</p>

		</section>
	
		<section id="quickstart-hive-full-nodes" class="row quickstart-hive-full-nodes">
			<h3>
				<a id="quickstart-hive-full-nodes">
					Hive Nodes
					
				</a>
			</h3>
			

			<p>Applications that interface directly with the Hive blockchain will need to connect to a <code class="highlighter-rouge">hived</code> node. Developers may choose to use one of the public API nodes that are available, or run their own instance of a node.</p>

<h3 id="public-nodes">Public Nodes</h3>

<p>Although <code class="highlighter-rouge">hived</code> fully supports WebSockets (<code class="highlighter-rouge">wss://</code> and <code class="highlighter-rouge">ws://</code>) public nodes typically do not.  All nodes listed use HTTPS (<code class="highlighter-rouge">https://</code>).  If you require WebSockets for your solutions, please consider setting up your own <code class="highlighter-rouge">hived</code> node or proxy WebSockets to HTTPS using <a href="https://gitlab.syncad.com/hive/lineman">lineman</a>.</p>

<table>
  <thead>
    <tr>
      <th>URL</th>
      <th>Owner</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>api.hive.blog</td>
      <td>@blocktrades</td>
    </tr>
    <tr>
      <td>api.openhive.network</td>
      <td>@gtg</td>
    </tr>
    <tr>
      <td>anyx.io</td>
      <td>@anyx</td>
    </tr>
    <tr>
      <td>api.hivekings.com</td>
      <td>@drakos</td>
    </tr>
    <tr>
      <td>hived.privex.io</td>
      <td>@privex</td>
    </tr>
    <tr>
      <td>rpc.ausbit.dev</td>
      <td>@ausbitbank</td>
    </tr>
    <tr>
      <td>api.pharesim.me</td>
      <td>@pharesim</td>
    </tr>
    <tr>
      <td>techcoderx.com</td>
      <td>@techcoderx</td>
    </tr>
    <tr>
      <td>rpc.esteem.app</td>
      <td>@esteem</td>
    </tr>
    <tr>
      <td>hive.roelandp.nl</td>
      <td>@roelandp</td>
    </tr>
  </tbody>
</table>

<p>For a report on the latest public full nodes, check the latest posts on <a href="https://hive.blog/@fullnodeupdate">@fullnodeupdate</a> by <a href="https://hive.blog/@holger80">@holger80</a>.</p>

<h3 id="private-nodes">Private Nodes</h3>

<p>The simplest way to get started is by deploying a pre-built dockerized container.</p>

<h5 id="dockerized-p2p-node">Dockerized p2p Node</h5>

<p><em>To run a p2p node (ca. 2GB of memory is required at the moment):</em></p>

<h5 id="dockerized-full-node">Dockerized Full Node</h5>

<p><em>to run a node with all the data (e.g. for supporting a content website) that uses ca. 140GB of memory and growing:</em></p>

<h3 id="syncing-blockchain">Syncing blockchain</h3>

<p>Normally syncing blockchain starts from very first, <code class="highlighter-rouge">0</code> genesis block. It might take long time to catch up with live network. Because it connectes to various p2p nodes in the Steem network and requests blocks from 0 to head block. It stores blocks in block log file and builds up the current state in the shared memory file. But there is a way to bootstrap syncing by using trusted <code class="highlighter-rouge">block_log</code> file. The block log is an external append only log of the blocks. It contains blocks that are only added to the log after they are irreversible because the log is append only.</p>

<p>Trusted block log file helps to download blocks faster. Various operators provide public block log file which can be downloaded from:</p>
<ul>
  <li>http://files.privex.io</li>
  <li>https://gtg.steem.house/get/blockchain</li>
</ul>

<p>Both <code class="highlighter-rouge">block_log</code> files updated periodically, as of April 2020 uncompressed <code class="highlighter-rouge">block_log</code> file size ~260 GB. (Docker container on <code class="highlighter-rouge">stable</code> branch of Hive source code has option to use <code class="highlighter-rouge">USE_PUBLIC_BLOCKLOG=1</code> to download latest block log and start Steem node with replay.)</p>

<p>Block log should be place in <code class="highlighter-rouge">blockchain</code> directory below <code class="highlighter-rouge">data_dir</code> and node should be started with <code class="highlighter-rouge">--replay-blockchain</code> to ensure block log is valid and continue to sync from the point of snapshot. Replay uses the downloaded block log file to build up the shared memory file up to the highest block stored in that snapshot and then continues with sync up to the head block.</p>

<p>Replay helps to sync blockchain in much faster rate, but as blockchain grows in size replay might also take some time to verify blocks.</p>

<p>There is another <a href="https://github.com/steemit/steem/issues/2391">trick which might help</a> with faster sync/replay on smaller equipped servers:</p>

<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>while :
do
   dd if=blockchain/block_log iflag=nocache count=0
   sleep 60
done
</code></pre></div></div>

<p>Above bash script drops <code class="highlighter-rouge">block_log</code> from the OS cache, leaving more memory free for backing the blockchain database. It might also help while running live, but measurement would be needed to determine this.</p>

<h5 id="few-other-tricks-that-might-help">Few other tricks that might help:</h5>

<p>For Linux users, virtual memory writes dirty pages of the shared file out to disk more often than is optimal which results in steemd being slowed down by redundant IO operations. These settings are recommended to optimize reindex time.</p>

<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>echo    75 | sudo tee /proc/sys/vm/dirty_background_ratio
echo  1000 | sudo tee /proc/sys/vm/dirty_expire_centisecs
echo    80 | sudo tee /proc/sys/vm/dirty_ratio
echo 30000 | sudo tee /proc/sys/vm/dirty_writeback_centisecs
</code></pre></div></div>

<p>Another settings that can be changed in <code class="highlighter-rouge">config.ini</code> is <code class="highlighter-rouge">flush</code> - it is to specify a target number of blocks to process before flushing the chain database to disk. This is needed on Linux machines and a value of 100000 is recommended. It is not needed on OS X, but can be used if desired.</p>

<p>(below info is outdated - need updating)</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker run <span class="se">\</span>
    <span class="nt">-d</span> <span class="nt">-p</span> 2001:2001 <span class="nt">-p</span> 8090:8090 <span class="nt">--name</span> steemd-default <span class="se">\</span>
    steemit/steem

docker logs <span class="nt">-f</span> steemd-default  <span class="c"># follow along</span>
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker run <span class="se">\</span>
    <span class="nt">--env</span> <span class="nv">USE_WAY_TOO_MUCH_RAM</span><span class="o">=</span>1 <span class="se">\</span>
    <span class="nt">-d</span> <span class="nt">-p</span> 2001:2001 <span class="nt">-p</span> 8090:8090 <span class="nt">--name</span> steemd-full <span class="se">\</span>
    steemit/steem

docker logs <span class="nt">-f</span> steemd-full
</code></pre></div></div>

		</section>
	
		<section id="quickstart-testnet" class="row quickstart-testnet">
			<h3>
				<a id="quickstart-testnet">
					Hive Testnet
					
				</a>
			</h3>
			

			<p>Hive blockchain software is written in C++ and in order to modify the source code you need some understanding of the C++ programming language. Each Hive node runs an instance of this software, so in order to test your changes, you will need to know how to install dependencies which can be found in the <a href="https://github.com/steemit/steem/blob/master/doc/building.md">Hive repo</a>. This also means that some knowledge of System administration is also required. There are multiple advantages of running a testnet, you can test your scripts or applications on a testnet without extra spam on the live network, which allows much more flexibility to try new things. Having access to a testnet also helps you to work on new features and possibly submit new or improved pull requests to official the Hive GitHub repository.</p>

<h2 id="hive-testnet">Hive Testnet</h2>

<p>More info soon</p>

<h3 id="features">Features</h3>

<p><em>Old text: Will be replaced:</em>
The official Steemit, Inc. Testnet is a mirror of the mainnet.  This is achieved by copying the existing accounts and transactions from the mainnet state, as the they happen.  Accounts are copied from a <a href="https://github.com/steemit/tinman#taking-a-snapshot">snapshot</a> of mainnet while the module used to copy transactions in real time is called <a href="https://github.com/steemit/tinman#gatling-transactions-from-mainnet"><code class="highlighter-rouge">gatling</code></a>.  The <code class="highlighter-rouge">gatling</code> module runs at the final step of each testnet deployment.</p>

<p>The combination of <code class="highlighter-rouge">snapshot</code> and <code class="highlighter-rouge">gatling</code> means that this testnet approaches a subset of the same activity that the mainnet experiences.  Not everything can be mirrored.  For example, if someone comments or votes on a post that hasn’t been mirrored to the testnet (because the post itself pre-dates the testnet deploy), those operations will also not be included.</p>

<p>At the time of this writing, the connection information for Steemit’s testnet is as follows:</p>

<ul>
  <li>ChainID: <code class="highlighter-rouge">d043ab83d223f25f37e1876fe48a240d49d8e4b1daa2342064990a8036a8bb5b</code></li>
  <li>Address prefix: <code class="highlighter-rouge">TST</code></li>
  <li>API node: <code class="highlighter-rouge">https://testnet.steemitdev.com</code></li>
</ul>

<h2 id="running-a-testnet-node">Running a Testnet Node</h2>

<p>First, let’s build <code class="highlighter-rouge">steemd</code> specifically for testnet.  Recommended specs:</p>

<ul>
  <li><code class="highlighter-rouge">Ubuntu Server 18.04 LTS</code></li>
  <li><code class="highlighter-rouge">100GB HDD</code></li>
  <li><code class="highlighter-rouge">16GB RAM</code> (mostly needed for <code class="highlighter-rouge">steemd</code> build)</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>apt-get update <span class="o">&amp;&amp;</span> <span class="nb">sudo </span>apt-get dist-upgrade
<span class="nb">sudo </span>reboot

<span class="nb">sudo </span>apt-get <span class="nb">install </span>autoconf automake autotools-dev bsdmainutils build-essential cmake doxygen <span class="se">\</span>
   git libboost-all-dev libreadline-dev libssl-dev libtool ncurses-dev pbzip2 pkg-config <span class="se">\</span>
   python3-dev python3-jinja2 python3-pip libbz2-dev libsnappy-dev<span class="se">\</span>
   wget curl screen pv virtualenv nano xz-utils
<span class="nb">mkdir</span> <span class="nt">-p</span> src
<span class="nb">cd </span>src
git clone HIVED_OFFICIAL
<span class="nb">cd </span>steem
git checkout master <span class="c"># or a specific testnet branch</span>
git submodule update <span class="nt">--init</span> <span class="nt">--recursive</span>
<span class="nb">mkdir</span> <span class="nt">-p</span> build
<span class="nb">cd </span>build
cmake <span class="se">\</span>
   <span class="nt">-DCMAKE_BUILD_TYPE</span><span class="o">=</span>Release <span class="se">\</span>
   <span class="nt">-DBUILD_STEEM_TESTNET</span><span class="o">=</span>ON <span class="se">\</span>
   <span class="nt">-DLOW_MEMORY_NODE</span><span class="o">=</span>ON <span class="se">\</span>
   <span class="nt">-DCHAINBASE_CHECK_LOCKING</span><span class="o">=</span>ON <span class="se">\</span>
   <span class="nt">-DCLEAR_VOTES</span><span class="o">=</span>ON <span class="se">\</span>
   <span class="nt">-DSKIP_BY_TX_ID</span><span class="o">=</span>ON <span class="se">\</span>
   <span class="nt">-DSTEEM_LINT_LEVEL</span><span class="o">=</span>OFF <span class="se">\</span>
   ..
make <span class="nt">-j</span><span class="si">$(</span><span class="nb">nproc</span><span class="si">)</span> <span class="nb">install
cd
mkdir</span> <span class="nt">-p</span> testnet-data
<span class="nb">cd </span>testnet-data
nano config.ini
</code></pre></div></div>

<h3 id="configini"><code class="highlighter-rouge">config.ini</code></h3>

<div class="language-ini highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="py">log-console-appender</span> <span class="p">=</span> <span class="s">{"appender":"stderr","stream":"std_error"}</span>
<span class="py">log-file-appender</span> <span class="p">=</span> <span class="s">{"appender":"p2p","file":"logs/p2p/p2p.log"}</span>
<span class="py">log-logger</span> <span class="p">=</span> <span class="s">{"name":"default","level":"info","appender":"stderr"}</span>
<span class="py">log-logger</span> <span class="p">=</span> <span class="s">{"name":"p2p","level":"warn","appender":"p2p"}</span>

<span class="py">backtrace</span> <span class="p">=</span> <span class="s">yes</span>
<span class="py">plugin</span> <span class="p">=</span> <span class="s">chain p2p webserver witness database_api network_broadcast_api block_api</span>

<span class="py">shared-file-dir</span> <span class="p">=</span> <span class="s">"blockchain"</span>
<span class="py">shared-file-size</span> <span class="p">=</span> <span class="s">12G</span>
<span class="py">p2p-endpoint</span> <span class="p">=</span> <span class="s">0.0.0.0:2001</span>
<span class="py">webserver-http-endpoint</span> <span class="p">=</span> <span class="s">0.0.0.0:8751</span>
<span class="py">webserver-ws-endpoint</span> <span class="p">=</span> <span class="s">0.0.0.0:8752</span>

<span class="c"># testnet.steemitdev.com
</span><span class="py">p2p-seed-node</span> <span class="p">=</span> <span class="s">testnet.steemitdev.com:2001</span>
</code></pre></div></div>

<p>Then execute:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>steemd <span class="nt">--data-dir</span><span class="o">=</span><span class="nb">.</span> <span class="nt">--chain-id</span><span class="o">=</span>d043ab83d223f25f37e1876fe48a240d49d8e4b1daa2342064990a8036a8bb5b
</code></pre></div></div>

<p>Now let it sync, and you’ll have a shiny new testnet seed node to play with.</p>

<h2 id="custom-testnet">Custom Testnet</h2>

<p>In order to create a custom, isolated, testnet separate from the Steemit’s we need to modify a few things mentioned in the previous section.</p>

<p>In the file named <code class="highlighter-rouge">steem/libraries/protocol/include/steem/protocol/config.hpp</code>, we can see the first few lines dedicated to the Testnet section. The line starts with <code class="highlighter-rouge">#ifdef IS_TEST_NET</code>.</p>

<p>Let’s say we want to create a custom testnet with an initial supply of <strong>1,000,000 STEEM</strong>. We can change <code class="highlighter-rouge">STEEM_INIT_SUPPLY 1,000,000</code> and by changing <code class="highlighter-rouge">STEEM_CHAIN_ID_NAME "testnet"</code>, <strong>testnet</strong> to <strong>mytestnet</strong> we will automatically get a unique Chain ID for our testnet. The address prefix can be set to something like <strong>MTN</strong> and of course, we need to change the public and private keys to the genesis account. Note that the genesis account will receive the entire pre-mined supply of 1,000,000. That way, you can execute a setup script to fund any newly created accounts. Such a custom testnet will not have any additional hardware requirements to run.</p>

<p>A minimum of 8GB RAM should be sufficient to run a custom testnet. Currently, Hive only has Linux and Mac compiling guides to build. A testnet can either be hosted locally, on a rented AWS, or dedicated bare metal servers so one can start testing functionality, explore different APIs, and start developing.</p>

<p>One more crucial point to modify is to change the number of witnesses required to accept hardforks for a custom testnet, by default it is set to 17, we can change it to <strong>1</strong> <code class="highlighter-rouge">STEEM_HARDFORK_REQUIRED_WITNESSES 1</code> so that only one node instance would be sufficient and the network will be still functional and fast.</p>

<p>Another thing to note is that you can start a new chain with all previous hardforks already accepted, by changing the file named <code class="highlighter-rouge">steem/blob/master/libraries/chain/database.cpp</code> with the following function:</p>

<p><code class="highlighter-rouge">void database::init_genesis( uint64_t init_supply )</code> inside <code class="highlighter-rouge">try</code> add this line:</p>

<p><code class="highlighter-rouge">set_hardfork( 19, true );</code></p>

<p>This would mean that 19 hardforks have been accepted by witnesses and the new chain will start with all previous forks included.</p>

<p>After these changes, all we have to do is compile the source code and get the <code class="highlighter-rouge">steemd</code> executable. And once we fire up the custom testnet we can start testing and experimenting.</p>

<p>If you want to port some data from Hive main network you can use <a href="https://github.com/steemit/tinman">Tinman</a>, also developed by Steemit, to help with taking snapshots of the main network.</p>

<h4 id="custom-live-testnet">Custom live testnet</h4>

<p>An example of a custom testnet run by Hive community member <a href="https://steemit.com/@almost-digital">@almost-digital</a>. It doesn’t have a snapshot of the main network</p>

<ul>
  <li>ChainID: <code class="highlighter-rouge">79276aea5d4877d9a25892eaa01b0adf019d3e5cb12a97478df3298ccdd01673</code></li>
  <li>Address prefix: <code class="highlighter-rouge">STX</code></li>
  <li>API node: <code class="highlighter-rouge">https://testnet.steem.vc</code></li>
</ul>

		</section>
	


</div>
<div class="footer">
  <a href="#">Back to top</a>
</div>
<script>
    document.getElementById("open-nav").addEventListener("click", function () {
        document.body.classList.toggle("nav-open");
    });
</script>
</body>
</html>


<script src="/js/adjust.js"></script>

